<cfset BASE = CreateObject("component", "#session.rootDir#.cfc.base") />
<cfset mainQueries = CreateObject("component", "#session.rootDir#.cfc.queries") />
<cfinclude template="/code_lib/SCF_Employee.cfm">
<cfinclude template="/code_lib/SCF_HR.cfm">
<cfinclude template="/code_lib/SCF_REGEX.cfm">

<cfoutput>
<!---HTML header, css links, js links, and page title--->
#BASE.htmlTerminationHeader(
    "", <!---JS links--->
    "", <!---CSS links--->
    "Step 5:  Payroll - Termination", <!---Page Title--->
    "Status" <!---Active Nav Link--->
)#
<!---HTML header, css links, js links, and page title--->

<cfset BASE = CreateObject("component", "#session.rootDir#.cfc.base") />
<cfset mainQueries = CreateObject("component", "#session.rootDir#.cfc.queries") />
<cfset statusQueries = CreateObject("component", "#session.rootDir#.cfc.statusQueries") />


<cfif Session.bolAuth EQ True and (Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR)>

    <cfset QUERIES.GetStep4Waiting = statusQueries.funcGetTerminationSCFStepWaiting(26) />
	
	<h1 class="title">Step 5:  Payroll - Termination </h1>
	<div class="entry">
		Welcome, #Session.arrEmpInfo.FirstName# #Session.arrEmpInfo.LastName#.  
		In this step, we'll confirm that the terminated individuals 
		have indeed been terminated in the financial system.  
		This is the list of employees that are staged for 
		termination in Finance.  After successfully terminating the 
		employee, please place a check in the box next to their name 
		and hit the "Complete" button.  This will update their EPAR 
		record and remove them from the Finance queue. 
		   <BR /><BR />
	
		<cfif QUERIES.GetStep4Waiting.recordcount GT 0>
			<table width="100%">
				<tr>
					<td align="left" width=100%>
						<cfform name="frmStep4" method="post" action="api.cfm?api=step5_payroll_termination">
							<table width="100%" >
								<tr>
                                    <td>&nbsp;</td>                                 
                                    <td align="left">
                                       <strong>Name</strong>
                                    </td>
                                    <td align="left">
                                       <strong>Term Date</strong>
                                    </td>
                                    <td align="left">
                                       <strong>HRID</strong>
                                    </td>
                                    <td align="left">
                                       <strong>NavID</strong>
                                    </td>
                                    <td align="left">
                                       <strong>TimeKeeperID</strong>
                                    </td>
                                    <td align="left">
                                       <strong>Cost Code</strong>
                                    </td>
                                </tr>
								<cfloop query="QUERIES.GetStep4Waiting" >
									<cfset objTerm = SCF_Employee_GetEmployee( QUERIES.GetStep4Waiting.RosettaID ) />
									<cfset QUERIES.GetTermDetails = mainQueries.funcGetTermDetails( QUERIES.GetStep4Waiting.TermReqID, 26 ) />
									<tr>
										<td align="center" valign="absmiddle">
                                            <cfinput type="checkbox" name="Term#QUERIES.GetTermDetails.ActionStepID#" value="#QUERIES.GetTermDetails.TermReqID#">
									    </td>
									    <td align="left">
                                            #objTerm.FirstName# #objTerm.LastName#
                                        </td>
                                        <td align="left">
                                            #DateFormat( QUERIES.GetTermDetails.TermDate, "M/DD/YYYY" )#
                                        </td>
                                        <td align="left">
                                            #objTerm.HR_PERSONIDNO#
                                        </td>
                                        <td align="left">
                                            #objTerm.FINANCE_IDNO#
                                        </td>
                                        <td align="left">
                                            #objTerm.TIMEKEEPER_IDNO#
                                        </td>
                                        <td align="left">
                                            #QUERIES.GetTermDetails.CostCode#
                                        </td>
									</tr>
								</cfloop>
								<tr>
                                    <td colspan="7">&nbsp;</td>
                                </tr>
								<tr>
	                                <td align="Left"  colspan="7">
									    <cfinput type="hidden" name="FormSubmit" value="">
									    <cfinput type="submit" name="Complete" value="Complete">
								    </td>
								</tr>
							</table>
						</cfform>  
					</td>
				</tr>
			</table>
		<cfelse>
		  <span class="error">At the present time, there are not any employees staged for termination.</span>
		</cfif>
	
	</div>

<cfelse>
    <cfinclude template="../denied.cfm">
</cfif>

<!---HTML footer, closes html and body tags.  Any footer info goes here--->
#BASE.htmlTerminationFooter()#
<!---HTML footer, closes html and body tags.  Any footer info goes here--->
</cfoutput>
